<?php
/**
 * 启动加载
 */
class Bootstrap extends Yaf_Bootstrap_Abstract
{

	/**
	 * 初始配置
	 * @method _initConfig
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function _initConfig(Yaf_Dispatcher $dispatcher)
	{
		$config = Yaf_Application::app()->getConfig()->toArray();
		//添加配置项数组到对象注册表里, 实现全项目可用
		Yaf_Registry::set('config', $config);
		/*路由配置*/
		$dispatcher->getRouter()->addConfig($config['routes']);
		/*缓存开启，调用缓存*/
		if ($config['cache']['open'])
		{
			$CachePlugin = new CachePlugin();
			/*注册缓存插件*/
			$dispatcher->registerPlugin($CachePlugin);
		}

	}
}